<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
		<meta http-equiv="content-security-policy">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../css/mui.min.css" />
		<script type="text/javascript" charset="utf-8">
			// 判断runtime是否支持5+ API
			if(navigator.userAgent.indexOf("Html5Plus") < 0) { //不支持5+ API
				checked("不支持5+ API");
			} else { //支持5+ API
				checked("支持5+ API");
			}
			// 输出检测结果
			function checked(ret) {
				if(document.body) {
					document.getElementById("checked").innerText = ret;
				} else {
					document.addEventListener("DOMContentLoaded", function() {
						document.getElementById("checked").innerText = ret;
					}, false);
				}
			}
		</script>
	</head>

	<body id="test">
		<div class="mui-content">
			{{items}}
		</div>
		<h1>Runtime supports 5+ Plus?</h1>
		<p id="checked">checking...</p>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="../../js/jquery.js"></script>
		<button type="button" id="confirm" class="mui-btn mui-btn-royal mui-btn-block">发送请求</button>
		<script type="text/javascript">
			mui.init({
				swipeBack: true //启用右滑关闭功能
			});
			//发送请求按钮的点击事件
			document.getElementById("confirm").addEventListener('tap', function() {
				var url = base+"test/index.json";
				mui.ajax(url, {
//					dataType: 'json', //服务器返回json格式数据
					type: 'GET', //HTTP请求类型
//					timeout: 5000, //超时时间设置为10秒；
//					async: false,
//					crossDomain:true,
//					headers:{'Content-Type':'application/json'},
					success: function(data) {
						//JSON.stringify()将 JSON对象转为json字符串 
						//						var data = JSON.stringify(data);
						alert(data);
					},
					error: function(xhr, type, errorThrown) {
						//异常处理；
						console.log(type);
					}
				});
			});
		</script>
	</body>

</html>